<template>
	<div id="affirm">
		<table class="search-table">
			<tr>
				<td>任务编号: <input type="text"> </td>
				<td>线路编号: <input type="text"> </td>
				<td>杆塔编号: <input type="text"> </td>
				<td>发现人: <input type="text"> </td>
			</tr>
			<tr>
				<td>缺陷类型:
					<select>
						<option value="">--请选择--</option>
					</select>
				</td>
				<td>
					缺陷级别:
					<select>
						<option value="">--请选择--</option>
					</select>
				</td>
				<td>
					发现时间: <input type="text"> to <input type="text">
				</td>
				<td>
					<input type="button" value="查询">
				</td>
			</tr>
		</table>
		<input type="button" value="保存">
		<hr>
		<table class="result-table">
			<tr>
				<th>任务编号</th>
				<th>线路编号</th>
				<th>杆塔编号</th>
				<th>缺陷类型</th>
				<th>完好率</th>
				<th>缺陷描述</th>
				<th>发现时间</th>
				<th>发现人员</th>
				<th>缺陷级别</th>
			</tr>
			<tr v-for="(item, index) in tableData" :key="index" :class="{ 'even-row': index % 2 === 0 }">
				<td>{{ item.taskid }}</td>
				<td>{{ item.linecode }}</td>
				<td>{{ item.polecode }}</td>
				<td>{{ item.bugtypename }}</td>
				<td>{{ item.intactrate }}</td>
				<td>{{ item.bugdesc }}</td>
				<td>{{ item.discovertime }}</td>
				<td>{{ item.discoverername }}</td>
				<td>{{ item.buglevelname }}</td>
			</tr>
		</table>
	</div>
</template>

<script>
	import {queryDefetInfos} from '../../config/request.js'
	export default {
		data() {
			return {
				tableData: [],
			};
		},
		created() {
			queryDefetInfos().then(res=>{ 
				this.tableData = res.data.pageInfo.list;
			}).catch(err=>{
				
			})
		}
	};
</script>

<style>
	#affirm {
		text-align: center;
	}

	.search-table,
	.result-table {
		width: 80%;
		margin: 20px auto;
		border-collapse: collapse;
	}

	.search-table td,
	.result-table td,
	.search-table th,
	.result-table th {
		padding: 8px;
		border: 1px solid #ddd;
	}

	.search-table input[type="text"],
	.search-table select,
	.search-table input[type="button"] {
		padding: 6px;
		width: 100px;
	}

	.search-table input[type="button"] {
		cursor: pointer;
	}

	.even-row {
		background-color: #f2f2f2;
	}
</style>